package models.mapper;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import models.DrCase;
import models.DrCaseExample;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface DrCaseMapper {
    int countByExample(DrCaseExample example);

    int deleteByExample(DrCaseExample example);

    int deleteByPrimaryKey(String caseid);

    int insert(DrCase record);

    int insertSelective(DrCase record);

    List<DrCase> selectByExample(DrCaseExample example);

    DrCase selectByPrimaryKey(String caseid);

    int updateByExampleSelective(@Param("record") DrCase record, @Param("example") DrCaseExample example);

    int updateByExample(@Param("record") DrCase record, @Param("example") DrCaseExample example);

    int updateByPrimaryKeySelective(DrCase record);

    int updateByPrimaryKey(DrCase record);
    @Select("select caseid from DR_CASE "
    		+ "where status=1 or status=4")
	List<DrCase> getLivingCase();
    /**
     * 统计某日某状态数量
     * @param status 状态
     * @param today 日期
     * @param today2 
     * @return
     */
    @Select("select count(1) from DR_CASE ${filed} and to_char(opendate,'yyyy-MM-dd')=#{date}")
	long countTodayCourt(@Param("status")BigDecimal status,@Param("filed")String filed,@Param("date") String today);
}